package routes

import (
	"github.com/gofiber/fiber/v2"
	"shopx/app/controllers/web"
)

//注册WEB路由
func Web(router fiber.Router) {
	// Homepage
	router.Get("/", web.Entry.Index)

	// Panic test route, this brings up an error
	//router.Get("/panic", func(ctx *fiber.Ctx) error {
	//	panic("Hi, I'm a panic error!")
	//})
	//
	//// Test to load static, compiled assets
	//router.Get("/test", func(c *fiber.Ctx) error {
	//	return c.Render("test", fiber.Map{})
	//})
	//
	//// Make a new hash
	//router.Get("/hash/*", func(ctx *fiber.Ctx) error {
	//	hash, err := hasher.CreateHash(ctx.Params("*"))
	//	if err != nil {
	//		log.Fatalf("Error when creating hash: %v", err)
	//	}
	//	if err := ctx.SendString(hash); err != nil {
	//		panic(err.Error())
	//	}
	//	return err
	//})
	//
	//// Auth routes
	//router.Get("/login", Controller.ShowLoginForm())
	//router.Post("/login", Controller.PostLoginForm(hasher, session, db))
	//router.Post("/logout", Controller.PostLogoutForm(sessionLookup, session, db))
}
